<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>生产过程管理系统</title>
    <link rel="stylesheet" href="css/style.css">
    <style>
        .submenu {
            display: none;
        }
        .menu-item.active > .submenu {
            display: block;
        }
        .menu-arrow {
            transition: transform 0.2s;
        }
        .menu-item.active > a > .menu-arrow {
            transform: rotate(90deg);
        }
    </style>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            var menuItems = document.querySelectorAll('.menu-item > a');
            menuItems.forEach(function (item) {
                item.addEventListener('click', function (e) {
                    var parent = item.parentElement;
                    // 只允许单开一个折叠区
                    document.querySelectorAll('.menu-item').forEach(function (el) {
                        if (el !== parent) el.classList.remove('active');
                    });
                    parent.classList.toggle('active');
                    e.preventDefault();
                });
            });
        });
    </script>
</head>
<body>
    <div class="admin-layout">
        <!-- 顶部导航栏 -->
        <header class="admin-header">
            <div class="header-left">
                <div class="logo">生产过程管理系统</div>
            </div>
            <div class="header-right">
                <span class="user-info">管理员</span>
                <button class="logout-btn" onclick="logout()">退出</button>
            </div>
        </header>
        
        <!-- 左侧菜单 -->
        <aside class="admin-sidebar">
            <ul class="menu-list">
                <li class="menu-item">
                    <a href="javascript:void(0)">
                        <span class="menu-icon">👥</span>
                        <span class="menu-title">人员管理</span>
                        <span class="menu-arrow"></span>
                    </a>
                    <ul class="submenu">
                        <li><a href="modules/person/person_list.html">人员列表</a></li>
                        <li><a href="modules/person/person_edit.html">添加人员</a></li>
                    </ul>
                </li>
                <li class="menu-item">
                    <a href="javascript:void(0)">
                        <span class="menu-icon">📦</span>
                        <span class="menu-title">物料管理</span>
                        <span class="menu-arrow"></span>
                    </a>
                    <ul class="submenu">
                        <li><a href="modules/material/material_list.html">物料列表</a></li>
                        <li><a href="modules/material/material_edit.html">添加物料</a></li>
                    </ul>
                </li>
                <li class="menu-item">
                    <a href="javascript:void(0)">
                        <span class="menu-icon">⚙️</span>
                        <span class="menu-title">设备管理</span>
                        <span class="menu-arrow"></span>
                    </a>
                    <ul class="submenu">
                        <li><a href="modules/device/device_list.html">设备列表</a></li>
                        <li><a href="modules/device/device_edit.html">添加设备</a></li>
                    </ul>
                </li>
                <li class="menu-item">
                    <a href="javascript:void(0)">
                        <span class="menu-icon">📝</span>
                        <span class="menu-title">产品管理</span>
                        <span class="menu-arrow"></span>
                    </a>
                    <ul class="submenu">
                        <li><a href="modules/product/product_list.html">产品列表</a></li>
                        <li><a href="modules/product/product_edit.html">添加产品</a></li>
                    </ul>
                </li>
                <li class="menu-item">
                    <a href="javascript:void(0)">
                        <span class="menu-icon">🏢</span>
                        <span class="menu-title">供应商管理</span>
                        <span class="menu-arrow"></span>
                    </a>
                    <ul class="submenu">
                        <li><a href="modules/provider/provider_list.html">供应商列表</a></li>
                        <li><a href="modules/provider/provider_edit.html">添加供应商</a></li>
                    </ul>
                </li>
            </ul>
        </aside>
        
        <!-- 主内容区域 -->
        <main class="admin-main">
            <!-- 工作区内容先不实现 -->
        </main>
    </div>
</body>
<script>
function logout() {
    // 添加确认提示
    if (confirm('确定要退出登录吗？')) {
        // 清除本地存储的登录信息
        localStorage.removeItem('userInfo');
        localStorage.removeItem('token');
        
        // 跳转到登录页面
        window.location.href = 'login.html';
    }
}
</script>
</html>